
import React from 'react';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import ListItemText from '@material-ui/core/ListItemText';
import InboxIcon from '@material-ui/icons/MoveToInbox';
import MailIcon from '@material-ui/icons/Mail';
import Divider from '@material-ui/core/Divider';
import { createHashHistory } from 'history'; // 如果是hash路由

const history = createHashHistory();

export default function MenuList(){
    function changeRoute(path){
        history.push(path);
    }
    return (
        <React.Fragment>
            <List>
                <ListItem button key={'members'}>
                    <ListItemIcon><InboxIcon/></ListItemIcon>
                    <ListItemText onClick={() => changeRoute('/members')} primary="成员管理"/>
                </ListItem>
                <ListItem button key={'message'}>
                    <ListItemIcon><InboxIcon/></ListItemIcon>
                    <ListItemText onClick={() => changeRoute('/messages')} primary="消息"/>
                </ListItem>
            </List> 
        </React.Fragment>
    )
};
